package com.forenow.demo.demo6;
import java.util.Scanner;
public class Test extends Person{       //继承关系
    @Override
    public boolean Login(String user, String password) {  //父类中抽象方法的重写
        String user1="tom";
        String password1="123";
        if (user.equals(user1)&&password.equals(password1)) {
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean Register(String user, String password) {
        return false;
    }

    @Override
    public void IdShow(int id) {

    }

    @Override
    public void ShowAll() {

    }

    @Override
    public void Delete(int id) {

    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String user=scanner.next();
        String password=scanner.next();
        Person person=new Test();  //父类的引用指向子类的对象
        boolean iflogin=person.Login(user,password);
        if (iflogin) {
            System.out.println("登录成功");
        }else {
            System.out.println("登录失败");

        }
    }
}
